﻿Public Class AutoCompleteEntry
    Private m_keywordStrings As String()
    Private displayString As String

    Public Property Id As Integer
    Public Property Value As String

    Public ReadOnly Property KeywordStrings() As String()
        Get
            If m_keywordStrings Is Nothing Then
                m_keywordStrings = New String() {displayString}
            End If
            Return m_keywordStrings
        End Get
    End Property

    Public Property DisplayName() As String
        Get
            Return displayString
        End Get
        Set(value As String)
            displayString = value
        End Set
    End Property

    Public Sub New(name As String, id As Integer, value As String, ParamArray keywords As String())
        displayString = name
        Me.Id = id
        Me.Value = value
        m_keywordStrings = keywords
    End Sub

    Public Overrides Function ToString() As String
        Return displayString
    End Function
End Class